﻿using AntdUI;
using ImportPlcPointPosition.Utils;
using SqlSugar;
using SqlSugar.Extensions;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Runtime.InteropServices.JavaScript.JSType;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;

namespace ImportPlcPointPosition.Controls.Base
{
    public class BaseUserControl : UserControl
    {
        public BaseUserControl()
        {

        }

        /// <summary>
        /// 页面刷新方法(可重写)
        /// </summary>
        public virtual void ReflushPage()
        {

        }


        #region MainLayout Alert Methods
        public void MessageSuccess(string msg)
        {
            App.MainLayout.AlertSuccess(msg);
        }

        public void MessageInfo(string msg)
        {
            App.MainLayout.AlertInfo(msg);
        }


        public void MessageError(string msg)
        {
            App.MainLayout.AlertError(msg);
        }

        public void MessageWarn(string msg)
        {
            App.MainLayout.AlertWarn(msg);
        }
        #endregion

        #region Confirm MessageBox
        public DialogResult MessageBoxShow(string message, TType type = TType.Info)
        {
            return App.MainLayout.AlertConfirm(message, type);
        }

        public DialogResult MessageBoxWarn(string message)
        {
            return App.MainLayout.AlertConfirm(message, TType.Warn);
        }

        public DialogResult MessageBoxError(string message)
        {
            return App.MainLayout.AlertConfirm(message, TType.Error);
        }
        #endregion

    }
}
